package com.ruoyi.project.oms.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.db.oms.domain.OmsOrderGoods;
import com.ruoyi.project.oms.service.OmsOrderGoodsService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;

/**
 * 订单商品Controller
 *
 * @author yfy
 * @date 2020-04-25
 */
@Api(tags="oms管理：订单商品管理")
@RestController
@RequestMapping("/oms/order_goods")
public class OmsOrderGoodsController extends BaseController
{
    @Autowired
    private OmsOrderGoodsService omsOrderGoodsService;

    @ApiOperation("查询订单商品列表")
    @Log(title = "订单商品", businessType = BusinessType.OTHER)
    @PreAuthorize("@ss.hasPermi('oms:order_goods:list')")
    @GetMapping("/list/{orderId}")
    public TableDataInfo getOrderGoodsList(@PathVariable("orderId") Long orderId)
    {
        List<OmsOrderGoods> list = omsOrderGoodsService.getOrderGoodsList(orderId);
        return getDataTable(list);
    }

}
